﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using DataLib.Common;
using System.Drawing;
using DataLib.Accounts.Bus;

namespace Ewts.BaseData
{
    public partial class CustomerList : System.Web.UI.Page
    {



        DataLib.BLL.Cumtomer bll = new DataLib.BLL.Cumtomer();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        protected void BindData()
        {
            User curUser = new DataLib.Accounts.Bus.User();
            curUser = (User)Session["UserInfo"];
            DataTable dt = new DataTable();
            switch (curUser.UserType)
            {
                case "AD":
                    dt = new DataLib.BLL.Cumtomer().GetDataByCity("");
                    break;
                //case "AA":
                //    dt = curUser.GetUsersByType("AA", curUser.CompanyCity, curUser.UserName);
                //    break;
                //case "AS":
                //    dt = curUser.GetUsersByType("", curUser.CompanyCity, curUser.UserName);
                //    break;
                //case "DD":
                //case "AR":
                //    dt = curUser.GetUsersByType("", curUser.CompanyCity, "业务员");
                //    break;
                default:
                    dt = new DataLib.BLL.Cumtomer().GetDataByCity(curUser.CompanyCity);
                    break;
            }
 
            reptCustomer.DataSource = dt;
            reptCustomer.DataBind();
        }

    }
}